package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.BarbecuteDaoEntity;
import com.sxx.beautifulcity.entity.greendao.BarbecuteDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/2.
 */
public class BarbecueHelper {
    private DaoSingleton instance = DaoSingleton.getInstance();
    private BarbecuteDaoEntityDao barbecuteDao;

    public BarbecueHelper(){
        this.barbecuteDao = instance.getBarbecuteDao();
    }
    public void savaBarbecuteList(List<BarbecuteDaoEntity> daoEntities){
        barbecuteDao.insertInTx(daoEntities);
    }
    public void deleteBarbecuteList(List<BarbecuteDaoEntity> daoEntities){
        barbecuteDao.deleteAll();
    }
    public List<BarbecuteDaoEntity> queryBarbecuteAll(){
        return barbecuteDao.loadAll();
    }
}
